<!DOCTYPE html>
<html lang="ch" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>选择变量表达式</title>
</head>
<body>
<div>
    <div>
        <h3>变量表达式</h3>
        <div>
            <p th:text="${userDto.userId}"></p>
            <p th:text="${userDto.username}"></p>
            <p th:text="${userDto.realName}"></p>
            <p th:text="${userDto.age}"></p>
            <p th:text="${userDto.sex}"></p>
            <p th:text="${userDto.createTime}"></p>
        </div>

        <h3>选择变量表达式</h3>
        <div th:object="${userDto}"> <!--选择变量表达式能使代码更简介-->
            <p th:text="*{userId}"></p>
            <p th:text="*{username}"></p>
            <p th:text="*{realName}"></p>
            <p th:text="*{age}"></p>
            <p th:text="*{sex}"></p>
            <p th:text="*{createTime}"></p>
        </div>
    </div>
</div>
</body>
</html>